{include file='../common_admin/left_bar.php'}
<form enctype="multipart/form-data"  method="post">
    <div style="padding: 10px;">
        <h2>经典游戏设置</h2>

        <div class="table_main">
            <table class="tb tb2 nobdb">
                <tbody>
                <tr class="noborder">
                    <td class="td_l">小程序开关:</td>
                    <td class="vtop rowform">
                        <input class="radio" type="radio" name="check_we_app" value="1" {if 1 == $check_we_app}checked="checked"{/if}>
                        &nbsp;开
                        <input class="radio" type="radio" name="check_we_app" value="0" {if 0 == $check_we_app}checked="checked"{/if}>
                        &nbsp;关
                    </td>
                    <td class="vtop tips2">小程序是否打开，如果是关，则进入提问界面，如果是开，则进入拼多多商品推广首页</td>
                </tr>

                <tr>
                    <td>&nbsp;</td>
                    <td colspan="2">
                        <div class="fixsel">
                            <input type="button" class="btn submit_btn" value="提交" onclick="go_submit()">
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <script type="text/javascript">
        function go_submit() {
            var check_we_app = $('input:radio[name="check_we_app"]:checked').val();
            if (null == check_we_app) {
                alert("什么也没有选中");
                return;
            }

            $.ajax({
                url: '{$URL}m=games&a=setting_save',
                data: {
                    'check_we_app': check_we_app
                },
                type: 'post',
                dataType: 'json',
                success: function (data) {
                    if (data.r == 0) {
                        alert('修改成功!');

                        location.href = '{$URL}m=games&a=setting';
                    } else {
                        alert('修改失败!');
                    }
                },
                error: function () {
                    alert('修改失败!');
                }
            });
        }
    </script>
</form>
{include file='../common_admin/right_bar.php'}